#!/bin/bash
timename=$(date "+%Y%m%d")
ip=`hostname -i`

filename=$timename-$ip.log
logpath="/home/chiaws/chia-blockchain"
if [ -d $logpath ];then
  grep -rn "Total time" $logpath/plots* > ./$filename
  chiapath="/home/chiap/log"
  if [ -d $chiapath ];then
    cp ./$filename $chiapath/
  fi
  chiapath="/home/chianv/log"
  if [ -d $chiapath ];then
    cp ./$filename $chiapath/
  fi
fi


